package com.moly.grpc.studentmessage;

import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.19.0)",
    comments = "Source: StudentMessage.proto")
public final class StudentServiceGrpc {

  private StudentServiceGrpc() {}

  public static final String SERVICE_NAME = "routeguide.StudentService";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor<com.moly.grpc.studentmessage.Student,
      com.moly.grpc.studentmessage.Result> getGetResultMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "getResult",
      requestType = com.moly.grpc.studentmessage.Student.class,
      responseType = com.moly.grpc.studentmessage.Result.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<com.moly.grpc.studentmessage.Student,
      com.moly.grpc.studentmessage.Result> getGetResultMethod() {
    io.grpc.MethodDescriptor<com.moly.grpc.studentmessage.Student, com.moly.grpc.studentmessage.Result> getGetResultMethod;
    if ((getGetResultMethod = StudentServiceGrpc.getGetResultMethod) == null) {
      synchronized (StudentServiceGrpc.class) {
        if ((getGetResultMethod = StudentServiceGrpc.getGetResultMethod) == null) {
          StudentServiceGrpc.getGetResultMethod = getGetResultMethod = 
              io.grpc.MethodDescriptor.<com.moly.grpc.studentmessage.Student, com.moly.grpc.studentmessage.Result>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(
                  "routeguide.StudentService", "getResult"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.moly.grpc.studentmessage.Student.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.moly.grpc.studentmessage.Result.getDefaultInstance()))
                  .setSchemaDescriptor(new StudentServiceMethodDescriptorSupplier("getResult"))
                  .build();
          }
        }
     }
     return getGetResultMethod;
  }

  private static volatile io.grpc.MethodDescriptor<com.moly.grpc.studentmessage.Student,
      com.moly.grpc.studentmessage.Result> getGetStreamResultMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "getStreamResult",
      requestType = com.moly.grpc.studentmessage.Student.class,
      responseType = com.moly.grpc.studentmessage.Result.class,
      methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
  public static io.grpc.MethodDescriptor<com.moly.grpc.studentmessage.Student,
      com.moly.grpc.studentmessage.Result> getGetStreamResultMethod() {
    io.grpc.MethodDescriptor<com.moly.grpc.studentmessage.Student, com.moly.grpc.studentmessage.Result> getGetStreamResultMethod;
    if ((getGetStreamResultMethod = StudentServiceGrpc.getGetStreamResultMethod) == null) {
      synchronized (StudentServiceGrpc.class) {
        if ((getGetStreamResultMethod = StudentServiceGrpc.getGetStreamResultMethod) == null) {
          StudentServiceGrpc.getGetStreamResultMethod = getGetStreamResultMethod = 
              io.grpc.MethodDescriptor.<com.moly.grpc.studentmessage.Student, com.moly.grpc.studentmessage.Result>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
              .setFullMethodName(generateFullMethodName(
                  "routeguide.StudentService", "getStreamResult"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.moly.grpc.studentmessage.Student.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.moly.grpc.studentmessage.Result.getDefaultInstance()))
                  .setSchemaDescriptor(new StudentServiceMethodDescriptorSupplier("getStreamResult"))
                  .build();
          }
        }
     }
     return getGetStreamResultMethod;
  }

  private static volatile io.grpc.MethodDescriptor<com.moly.grpc.studentmessage.Student,
      com.moly.grpc.studentmessage.Result> getGetResultByStreamRequestMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "getResultByStreamRequest",
      requestType = com.moly.grpc.studentmessage.Student.class,
      responseType = com.moly.grpc.studentmessage.Result.class,
      methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING)
  public static io.grpc.MethodDescriptor<com.moly.grpc.studentmessage.Student,
      com.moly.grpc.studentmessage.Result> getGetResultByStreamRequestMethod() {
    io.grpc.MethodDescriptor<com.moly.grpc.studentmessage.Student, com.moly.grpc.studentmessage.Result> getGetResultByStreamRequestMethod;
    if ((getGetResultByStreamRequestMethod = StudentServiceGrpc.getGetResultByStreamRequestMethod) == null) {
      synchronized (StudentServiceGrpc.class) {
        if ((getGetResultByStreamRequestMethod = StudentServiceGrpc.getGetResultByStreamRequestMethod) == null) {
          StudentServiceGrpc.getGetResultByStreamRequestMethod = getGetResultByStreamRequestMethod = 
              io.grpc.MethodDescriptor.<com.moly.grpc.studentmessage.Student, com.moly.grpc.studentmessage.Result>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING)
              .setFullMethodName(generateFullMethodName(
                  "routeguide.StudentService", "getResultByStreamRequest"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.moly.grpc.studentmessage.Student.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.moly.grpc.studentmessage.Result.getDefaultInstance()))
                  .setSchemaDescriptor(new StudentServiceMethodDescriptorSupplier("getResultByStreamRequest"))
                  .build();
          }
        }
     }
     return getGetResultByStreamRequestMethod;
  }

  private static volatile io.grpc.MethodDescriptor<com.moly.grpc.studentmessage.Student,
      com.moly.grpc.studentmessage.Result> getGetStreamResultByStreamRequestMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "getStreamResultByStreamRequest",
      requestType = com.moly.grpc.studentmessage.Student.class,
      responseType = com.moly.grpc.studentmessage.Result.class,
      methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
  public static io.grpc.MethodDescriptor<com.moly.grpc.studentmessage.Student,
      com.moly.grpc.studentmessage.Result> getGetStreamResultByStreamRequestMethod() {
    io.grpc.MethodDescriptor<com.moly.grpc.studentmessage.Student, com.moly.grpc.studentmessage.Result> getGetStreamResultByStreamRequestMethod;
    if ((getGetStreamResultByStreamRequestMethod = StudentServiceGrpc.getGetStreamResultByStreamRequestMethod) == null) {
      synchronized (StudentServiceGrpc.class) {
        if ((getGetStreamResultByStreamRequestMethod = StudentServiceGrpc.getGetStreamResultByStreamRequestMethod) == null) {
          StudentServiceGrpc.getGetStreamResultByStreamRequestMethod = getGetStreamResultByStreamRequestMethod = 
              io.grpc.MethodDescriptor.<com.moly.grpc.studentmessage.Student, com.moly.grpc.studentmessage.Result>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
              .setFullMethodName(generateFullMethodName(
                  "routeguide.StudentService", "getStreamResultByStreamRequest"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.moly.grpc.studentmessage.Student.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.moly.grpc.studentmessage.Result.getDefaultInstance()))
                  .setSchemaDescriptor(new StudentServiceMethodDescriptorSupplier("getStreamResultByStreamRequest"))
                  .build();
          }
        }
     }
     return getGetStreamResultByStreamRequestMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static StudentServiceStub newStub(io.grpc.Channel channel) {
    return new StudentServiceStub(channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static StudentServiceBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    return new StudentServiceBlockingStub(channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static StudentServiceFutureStub newFutureStub(
      io.grpc.Channel channel) {
    return new StudentServiceFutureStub(channel);
  }

  /**
   */
  public static abstract class StudentServiceImplBase implements io.grpc.BindableService {

    /**
     */
    public void getResult(com.moly.grpc.studentmessage.Student request,
        io.grpc.stub.StreamObserver<com.moly.grpc.studentmessage.Result> responseObserver) {
      asyncUnimplementedUnaryCall(getGetResultMethod(), responseObserver);
    }

    /**
     */
    public void getStreamResult(com.moly.grpc.studentmessage.Student request,
        io.grpc.stub.StreamObserver<com.moly.grpc.studentmessage.Result> responseObserver) {
      asyncUnimplementedUnaryCall(getGetStreamResultMethod(), responseObserver);
    }

    /**
     */
    public io.grpc.stub.StreamObserver<com.moly.grpc.studentmessage.Student> getResultByStreamRequest(
        io.grpc.stub.StreamObserver<com.moly.grpc.studentmessage.Result> responseObserver) {
      return asyncUnimplementedStreamingCall(getGetResultByStreamRequestMethod(), responseObserver);
    }

    /**
     */
    public io.grpc.stub.StreamObserver<com.moly.grpc.studentmessage.Student> getStreamResultByStreamRequest(
        io.grpc.stub.StreamObserver<com.moly.grpc.studentmessage.Result> responseObserver) {
      return asyncUnimplementedStreamingCall(getGetStreamResultByStreamRequestMethod(), responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            getGetResultMethod(),
            asyncUnaryCall(
              new MethodHandlers<
                com.moly.grpc.studentmessage.Student,
                com.moly.grpc.studentmessage.Result>(
                  this, METHODID_GET_RESULT)))
          .addMethod(
            getGetStreamResultMethod(),
            asyncServerStreamingCall(
              new MethodHandlers<
                com.moly.grpc.studentmessage.Student,
                com.moly.grpc.studentmessage.Result>(
                  this, METHODID_GET_STREAM_RESULT)))
          .addMethod(
            getGetResultByStreamRequestMethod(),
            asyncClientStreamingCall(
              new MethodHandlers<
                com.moly.grpc.studentmessage.Student,
                com.moly.grpc.studentmessage.Result>(
                  this, METHODID_GET_RESULT_BY_STREAM_REQUEST)))
          .addMethod(
            getGetStreamResultByStreamRequestMethod(),
            asyncBidiStreamingCall(
              new MethodHandlers<
                com.moly.grpc.studentmessage.Student,
                com.moly.grpc.studentmessage.Result>(
                  this, METHODID_GET_STREAM_RESULT_BY_STREAM_REQUEST)))
          .build();
    }
  }

  /**
   */
  public static final class StudentServiceStub extends io.grpc.stub.AbstractStub<StudentServiceStub> {
    private StudentServiceStub(io.grpc.Channel channel) {
      super(channel);
    }

    private StudentServiceStub(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected StudentServiceStub build(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      return new StudentServiceStub(channel, callOptions);
    }

    /**
     */
    public void getResult(com.moly.grpc.studentmessage.Student request,
        io.grpc.stub.StreamObserver<com.moly.grpc.studentmessage.Result> responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(getGetResultMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void getStreamResult(com.moly.grpc.studentmessage.Student request,
        io.grpc.stub.StreamObserver<com.moly.grpc.studentmessage.Result> responseObserver) {
      asyncServerStreamingCall(
          getChannel().newCall(getGetStreamResultMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     */
    public io.grpc.stub.StreamObserver<com.moly.grpc.studentmessage.Student> getResultByStreamRequest(
        io.grpc.stub.StreamObserver<com.moly.grpc.studentmessage.Result> responseObserver) {
      return asyncClientStreamingCall(
          getChannel().newCall(getGetResultByStreamRequestMethod(), getCallOptions()), responseObserver);
    }

    /**
     */
    public io.grpc.stub.StreamObserver<com.moly.grpc.studentmessage.Student> getStreamResultByStreamRequest(
        io.grpc.stub.StreamObserver<com.moly.grpc.studentmessage.Result> responseObserver) {
      return asyncBidiStreamingCall(
          getChannel().newCall(getGetStreamResultByStreamRequestMethod(), getCallOptions()), responseObserver);
    }
  }

  /**
   */
  public static final class StudentServiceBlockingStub extends io.grpc.stub.AbstractStub<StudentServiceBlockingStub> {
    private StudentServiceBlockingStub(io.grpc.Channel channel) {
      super(channel);
    }

    private StudentServiceBlockingStub(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected StudentServiceBlockingStub build(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      return new StudentServiceBlockingStub(channel, callOptions);
    }

    /**
     */
    public com.moly.grpc.studentmessage.Result getResult(com.moly.grpc.studentmessage.Student request) {
      return blockingUnaryCall(
          getChannel(), getGetResultMethod(), getCallOptions(), request);
    }

    /**
     */
    public java.util.Iterator<com.moly.grpc.studentmessage.Result> getStreamResult(
        com.moly.grpc.studentmessage.Student request) {
      return blockingServerStreamingCall(
          getChannel(), getGetStreamResultMethod(), getCallOptions(), request);
    }
  }

  /**
   */
  public static final class StudentServiceFutureStub extends io.grpc.stub.AbstractStub<StudentServiceFutureStub> {
    private StudentServiceFutureStub(io.grpc.Channel channel) {
      super(channel);
    }

    private StudentServiceFutureStub(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected StudentServiceFutureStub build(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      return new StudentServiceFutureStub(channel, callOptions);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture<com.moly.grpc.studentmessage.Result> getResult(
        com.moly.grpc.studentmessage.Student request) {
      return futureUnaryCall(
          getChannel().newCall(getGetResultMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_GET_RESULT = 0;
  private static final int METHODID_GET_STREAM_RESULT = 1;
  private static final int METHODID_GET_RESULT_BY_STREAM_REQUEST = 2;
  private static final int METHODID_GET_STREAM_RESULT_BY_STREAM_REQUEST = 3;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final StudentServiceImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(StudentServiceImplBase serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_GET_RESULT:
          serviceImpl.getResult((com.moly.grpc.studentmessage.Student) request,
              (io.grpc.stub.StreamObserver<com.moly.grpc.studentmessage.Result>) responseObserver);
          break;
        case METHODID_GET_STREAM_RESULT:
          serviceImpl.getStreamResult((com.moly.grpc.studentmessage.Student) request,
              (io.grpc.stub.StreamObserver<com.moly.grpc.studentmessage.Result>) responseObserver);
          break;
        default:
          throw new AssertionError();
      }
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver<Req> invoke(
        io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_GET_RESULT_BY_STREAM_REQUEST:
          return (io.grpc.stub.StreamObserver<Req>) serviceImpl.getResultByStreamRequest(
              (io.grpc.stub.StreamObserver<com.moly.grpc.studentmessage.Result>) responseObserver);
        case METHODID_GET_STREAM_RESULT_BY_STREAM_REQUEST:
          return (io.grpc.stub.StreamObserver<Req>) serviceImpl.getStreamResultByStreamRequest(
              (io.grpc.stub.StreamObserver<com.moly.grpc.studentmessage.Result>) responseObserver);
        default:
          throw new AssertionError();
      }
    }
  }

  private static abstract class StudentServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    StudentServiceBaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return com.moly.grpc.studentmessage.StudentMessageProto.getDescriptor();
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("StudentService");
    }
  }

  private static final class StudentServiceFileDescriptorSupplier
      extends StudentServiceBaseDescriptorSupplier {
    StudentServiceFileDescriptorSupplier() {}
  }

  private static final class StudentServiceMethodDescriptorSupplier
      extends StudentServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    StudentServiceMethodDescriptorSupplier(String methodName) {
      this.methodName = methodName;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
      return getServiceDescriptor().findMethodByName(methodName);
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (StudentServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new StudentServiceFileDescriptorSupplier())
              .addMethod(getGetResultMethod())
              .addMethod(getGetStreamResultMethod())
              .addMethod(getGetResultByStreamRequestMethod())
              .addMethod(getGetStreamResultByStreamRequestMethod())
              .build();
        }
      }
    }
    return result;
  }
}
